home *** CD-ROM | disk | FTP | other *** search
- #==============================================================================
- # camera.test
- #------------------------------------------------------------------------------
- # Test of the Tcl SIPP camera commands.
- #------------------------------------------------------------------------------
- # Copyright 1992 Mark Diekhans
- # Permission to use, copy, modify, and distribute this software and its
- # documentation for any purpose and without fee is hereby granted, provided
- # that the above copyright notice appear in all copies. Mark Diekhans makes
- # no representations about the suitability of this software for any purpose.
- # It is provided "as is" without express or implied warranty.
- #------------------------------------------------------------------------------
- # $Id: camera.test,v 2.0 1992/11/02 03:55:52 markd Rel $
- #==============================================================================
-
-
- if {[info procs test] == ""} {source testprocs.tcl}
-
- #
- # Test SippCameraCreate command
- #
- test {camera-1.1} {
- SippCameraCreate {} {} {} 0 10
- } 1 {wrong # args: SippCameraCreate [position] [point] [upvector] [focal]}
-
- test {camera-1.2} {
- SippCameraCreate {1 2 3} {1 2 3} 0
- } 1 {vertex or vector must be a list of three elements}
-
- test {camera-1.3} {
- SippCameraCreate {x y z} {1 2 3} {4 5 7}
- } 1 {expected floating-point number but got "x"}
-
- test {camera-1.4} {
- SippCameraCreate {1 2 3} {1 2 3} {4 x 7}
- } 1 {expected floating-point number but got "x"}
-
- test {camera-1.5} {
- SippCameraCreate {1 2 3} {1 2 3} {4 x 7}
- } 1 {expected floating-point number but got "x"}
-
- test {camera-1.6} {
- SippCameraCreate {1 2 3} {1 2 3} {4 1 7} aaa
- } 1 {expected floating-point number but got "aaa"}
-
- test {camera-1.7} {
- SippCameraCreate {1 2 3} {1 2 3} {4 1 7}
- } 1 {The position and point may not be the same}
-
- test {camera-1.8} {
- SippCameraCreate {1 0 0} {0 0 0} {21 0 0}
- } 1 {The view vector (position to point) and up vector may not be parallel}
-
- test {camera-1.9} {
- set camera1 [SippCameraCreate {1 2 3} {0 0 0} {4 1 7}]
- crange $camera1 0 5
- } 0 {camera}
-
- test {camera-1.10} {
- set camera2 [SippCameraCreate {1 2 3} {0 0 0} {4 1 7} 10]
- crange $camera2 0 5
- } 0 {camera}
-
- test {camera-1.11} {
- set camera3 [SippCameraCreate {} {1 2 3} {4 1 7} 10]
- crange $camera3 0 5
- } 0 {camera}
-
- #
- # Test SippCameraParams command.
- #
- test {camera-2.1} {
- SippCameraParams
- } 1 {wrong # args: SippCameraParams camera [position] [point] [upvector] [focal]}
-
- test {camera-2.2} {
- SippCameraParams $camera1 {} {} {} 0 10
- } 1 {wrong # args: SippCameraParams camera [position] [point] [upvector] [focal]}
-
- test {camera-2.3} {
- SippCameraParams $camera1 {x y z} {1 2 3} {4 5 7}
- } 1 {expected floating-point number but got "x"}
-
- test {camera-2.4} {
- SippCameraParams $camera1 {1 2 3} {1 2 3} {4 x 7}
- } 1 {expected floating-point number but got "x"}
-
- test {camera-2.5} {
- SippCameraParams $camera1 {1 2 3} {1 2 3} {4 x 7}
- } 1 {expected floating-point number but got "x"}
-
- test {camera-2.6} {
- SippCameraParams $camera1 {1 2 3} {1 2 3} {4 1 7} aaa
- } 1 {expected floating-point number but got "aaa"}
-
- test {camera-2.7} {
- SippCameraParams $camera1 {1 2 3} {1 2 3} {4 1 7}
- } 1 {The position and point may not be the same}
-
- test {camera-2.8} {
- SippCameraParams $camera1 {1 0 0} {0 0 0} {11 0 0}
- } 1 {The view vector (position to point) and up vector may not be parallel}
-
- test {camera-2.9} {
- SippCameraParams $camera1 {1 0 0} {0 0 0} {4 1 7}
- } 0 {}
-
- test {camera-2.10} {
- SippCameraParams $camera1 {1 2 3} {0 0 0} {4 1 7} 10
- } 0 {}
-
- #
- # Test the SippCameraUse command.
- #
- test {camera-3.1} {
- SippCameraUse
- } 1 {wrong # args: SippCameraUse camera}
-
- test {camera-3.2} {
- SippCameraUse $camera1 fooo
- } 1 {wrong # args: SippCameraUse camera}
-
- test {camera-3.3} {
- SippCameraUse $camera1
- } 0 {}
-
- test {camera-3.4} {
- SippCameraUse STDCAMERA
- } 0 {}
-
-
- #
- # Test the SippCameraDestruct command.
- #
-
- test {camera-4.1} {
- SippCameraDestruct
- } 1 {wrong # args: SippCameraDestruct cameralist}
-
- test {camera-4.2} {
- SippCameraDestruct $camera1 $camera2
- } 1 {wrong # args: SippCameraDestruct cameralist}
-
- test {camera-4.3} {
- SippCameraDestruct [list $camera1 foo]
- } 1 {invalid camera handle: foo}
-
- test {camera-4.4} {
- list [catch {SippCameraDestruct [list $camera1 $camera1]} msg] \
- [crange $msg 0 31]
- } 0 {1 {duplicate handle in list: camera}}
-
- test {camera-4.5} {
- SippCameraDestruct $camera1
- } 0 {}
-
- test {camera-4.6} {
- SippCameraDestruct [list $camera2 $camera3]
- } 0 {}
-
-